<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
 *
 * == BEGIN LICENSE ==
 *
 * Licensed under the terms of any of the following licenses at your
 * choice:
 *
 *  - GNU General Public License Version 2 or later (the "GPL")
 *    http://www.gnu.org/licenses/gpl.html
 *
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 *    http://www.gnu.org/licenses/lgpl.html
 *
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 *    http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * == END LICENSE ==
-->
<html>
<head>
	<title></title>
	<script type="text/javascript">
var FCK = new Object() ;	// Used by fckconfig

// Used by FCKPanel.
var FCKFocusManager =
{
	Lock : function() {},
	Unlock : function() {}
} ;

var FCKLang =
{
	Dir : 'ltr'
} ;

	</script>
	<script src="../../../editor/_source/classes/fckiecleanup.js" type="text/javascript"></script>
	<script src="../../../editor/_source/fckscriptloader.js" type="text/javascript"></script>
	<script type="text/javascript">

FCKScriptLoader.Load( 'FCKPanel' ) ;

	</script>
	<script type="text/javascript">

if ( FCKBrowserInfo.IsIE )
	FCK.IECleanup = new FCKIECleanup( window ) ;

window.FCKUnloadFlag = true ;

var oPanel ;
var oPanelInner ;

window.onload = function()
{
	if ( /dir=rtl/.test( window.location.search ) )
	{
		document.getElementById( 'chkRTL' ).checked = true ;
		FCKLang.Dir = 'rtl' ;
	}

	FCKConfig.FloatingPanelsZIndex = 10000 ;

	// Automatically calculates the editor base path based on the _test directory.
	var sBasePath = document.location.pathname.substring(0, document.location.pathname.lastIndexOf('_test')) ;
	FCKConfig.BasePath = sBasePath + 'editor/';
	FCKConfig.Debug = true ;

	oPanel = new FCKPanel() ;
	oPanel.AppendStyleSheet( 'test1/test.css' ) ;
	oPanel.OnHide = Panel_OnHide ;
	oPanel.MainNode.innerHTML = '<table align="center" border="1" cellpadding="5"><tr><td nowrap>Left<\/td><td>to<\/td><td>Right<\/td><\/tr><\/table><input type="button" value="Show Child" onclick="Show( this );">' ;

	oPanelInner = oPanel.CreateChildPanel() ;
	oPanelInner.AppendStyleSheet( 'test1/test.css' ) ;
	oPanelInner.MainNode.innerHTML = '<table><tr><td nowrap>Test Fred<\/td><\/tr><\/table>' ;

	FCKTools.GetElementWindow( oPanel.MainNode ).Show = this.ShowInner ;

	document.body.onmouseup		= Body_OnMouseUp ;
	document.body.oncontextmenu	= FCKTools.CancelEvent ;
}

var bIsShowRelativeButton = false ;

function Show( relElement )
{
	oPanel.Show( 0, relElement.offsetHeight, relElement ) ;
}

function ShowInner( relElement )
{
	oPanelInner.Show( 0, relElement.offsetHeight, relElement ) ;
}

function AddContent()
{
	var eDiv = oPanel.MainNode.appendChild( oPanel.Document.createElement( 'DIV' ) ) ;
	eDiv.style.width = '300px' ;
	eDiv.innerHTML = 'This is <b>some<\/b> content' ;
}

function Body_OnMouseUp( e )
{
	var iButton = e ? e.which - 1 : event.button ;

	if ( FCKBrowserInfo.IsOpera )
	{
		if ( iButton != 0 || !e.ctrlKey || e.shiftKey || e.altKey )
			return ;
	}
	else if ( iButton != 2 )
		return ;

	oPanel.IsContextMenu = true ;

	oPanel.Show(
		e ? e.pageX : event.offsetX,
		e ? e.pageY : event.offsetY,
		e ? document.body : event.srcElement
	) ;

	oPanel.IsContextMenu = false ;

	bIsShowRelativeButton = false ;
}

function SwitchRTL()
{
	window.location = document.getElementById( 'chkRTL' ).checked ? '?dir=rtl' : '?dir=ltr' ;
}

var iHideCount = 0 ;

function Panel_OnHide()
{
	document.title = 'Hides: ' + ( ++iHideCount ) ;
}

	</script>
</head>
<body>
<form name="fake" action="test1.html" method="get">

	<div style="height: 200px">
		<!-- This div is here just to make some space -->
	</div>
	<table cellspacing="10" cellpadding="0" border="0">
		<tr>
			<td valign="top">
				<input type="button" value="Show Relative" onclick="Show( this );"><br>
				<br>
				<select>
					<option selected>&nbsp;</option>
					<option>This is an option of the select box</option>
					<option>Other option</option>
					<option>Some option</option>
				</select>
			</td>
			<td valign="top">
				<input type="button" value="Add Content" onclick="AddContent();">
			</td>
			<td valign="top">
			</td>
		</tr>
	</table>
	<div align="center">
		<iframe src="test1/innerpage.html" frameborder="0"></iframe>
	</div>
	<input id="chkRTL" type="checkbox" onclick="SwitchRTL( this.checked );">
	Right to Left (RTL)<br>
	<div style="height: 1000px; width: 1000px;">
		<!-- This div is here just to show the scrollbar -->
	</div>

</form>
</body>
</html>
